//
//  TestMiningAddressListCell.m
//  ShandsMod
//
//  Created by zh s on 2023/3/23.
//  Copyright © 2023 zh_s. All rights reserved.
//

#import "TestMiningAddressListCell.h"

@implementation TestMiningAddressListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryNone;
        self.backgroundColor = [UIColor clearColor];
        [self createView];
    }
    return self;
}

- (void)createView {
    UIView *backV = [[UIView alloc] init];
    [self.contentView addSubview:backV];
    backV.backgroundColor = UIColor.whiteColor;
    backV.frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 30);

    UILabel *titleLab = [[UILabel alloc] init];
    [backV addSubview:titleLab];
    titleLab.textColor = MAIN_BACKCOLOR;
    titleLab.font = FONT_NAME(FONT_Regular, 12);
    titleLab.text = @"";
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(37);
        make.top.mas_equalTo(2);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 18));
    }];
    _titleLab = titleLab;
    
    UIImageView *iconImg = [[UIImageView alloc] init];
    [backV addSubview:iconImg];
    iconImg.image = IMAGE_NAME(@"icon_tableview_star");
    [iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(18);
        make.centerY.mas_equalTo(titleLab.mas_centerY).mas_offset(0);
        make.height.width.mas_equalTo(12);
    }];
    
    UILabel *subtitleLab = [[UILabel alloc] init];
    [backV addSubview:subtitleLab];
    subtitleLab.textColor = MAIN_BACKCOLOR;
    subtitleLab.font = FONT_NAME(FONT_Regular, 12);
    subtitleLab.text = @"";
    subtitleLab.textAlignment = NSTextAlignmentRight;
    [subtitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(backV.mas_right).mas_offset(-17);
        make.centerY.mas_equalTo(titleLab.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 18));
    }];
    _subtitleLab = subtitleLab;
    

}


@end
